project(OPENVR)

if(OGREDEPS_PLATFORM_X64)
	set(PROCESSOR_ARCH "64")
else()
	set(PROCESSOR_ARCH "32")
endif()

# Get platform.
if(WIN32)
	set(PLATFORM_NAME "win")
elseif(UNIX AND NOT APPLE)
	if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
		set(PLATFORM_NAME "linux")
	endif()
elseif(APPLE)
	if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*" OR CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
		set(PLATFORM_NAME "osx")
	endif()
endif()

set(OPENVR_INCLUDE_DIR "${OPENVR_SOURCE_DIR}/headers" CACHE PATH "")
set(OPENVR_LIB_DIR "${OPENVR_SOURCE_DIR}/lib/${PLATFORM_NAME}${PROCESSOR_ARCH}" CACHE PATH "")
set(OPENVR_BIN_DIR "${OPENVR_SOURCE_DIR}/bin/${PLATFORM_NAME}${PROCESSOR_ARCH}" CACHE PATH "")
mark_as_advanced(OPENVR_INCLUDE_DIR)
mark_as_advanced(OPENVR_LIB_DIR)
mark_as_advanced(OPENVR_BIN_DIR)

if (OGREDEPS_INSTALL_DEV)
	install(DIRECTORY ${OPENVR_INCLUDE_DIR}/ DESTINATION include)
	install(DIRECTORY ${OPENVR_LIB_DIR}/ DESTINATION ${OGREDEPS_LIB_DIRECTORY}/${OGREDEPS_DEBUG_PATH})
	install(DIRECTORY ${OPENVR_LIB_DIR}/ DESTINATION ${OGREDEPS_LIB_DIRECTORY}/${OGREDEPS_RELEASE_PATH})
	install(DIRECTORY ${OPENVR_BIN_DIR}/ DESTINATION bin${OGREDEPS_DEBUG_PATH})
	install(DIRECTORY ${OPENVR_BIN_DIR}/ DESTINATION bin${OGREDEPS_RELEASE_PATH})
endif ()
